#ifndef MYSTARWIDGET_H
#define MYSTARWIDGET_H

#include <QWidget>
#include <QGLWidget>
#include <QKeyEvent>
namespace Ui {
class MyStarWidget;
}
typedef struct{
    float dist;
    quint8 r;
    quint8 g;
    quint8 b;
    float angle;
}Star;
class MyStarWidget : public QGLWidget
{
    Q_OBJECT

public:
    explicit MyStarWidget(QWidget *parent = 0);
    ~MyStarWidget();
    void initializeGL();
    void resizeGL(int w, int h);
    void paintGL();
protected:
    int LoadGLTextures();
    void DrawStar();
    void LightInit();
    void BlendInit();
private:
    void keyPressEvent(QKeyEvent* e);
    Ui::MyStarWidget *ui;
    GLuint mTexture[3];
    float mRotate_x;
    float mRotate_y;
    float mRotate_z;
    float mMove_z;

    Star mStars[100];
};

#endif // MYSTARWIDGET_H
